package com.twu.biblioteca;

import java.io.StringReader;
import java.util.List;

/**
 * Created by archoud on 3/5/14.
 */
public class Displayer {
    public String format(String header,List<?> list) {
        StringBuilder result = new StringBuilder("\n\n" + header + "\n\n");
        for (int i = 0; i < list.size(); i++) {
            String text = list.get(i).toString();
            int numeral = i + 1;
            result.append(numeral + ". " + text + "\n");
        }
        return result.toString();
    }
}
